package com.hdoit.apollo.web.purchase.modelconfig;

import com.hdoit.apollo.web.shop.providers.SupplierProvider;
import com.tennetcn.core.common.enums.regular.MathRegularExpressions;
import com.tennetcn.web.component.attribute.DisplayNameAttribute;
import com.tennetcn.web.component.attribute.DropDownListAttribute;
import com.tennetcn.web.component.attribute.RegularExpressionAttribute;
import com.tennetcn.web.component.attribute.base.ModelMetadataAttributeConfiguration;

/**
 * @author      humaoshu
 * @email       
 * @createtime  2018年05月23日 11:11:57
 * @comment
 */
public class PurchaseCollocationConfig extends ModelMetadataAttributeConfiguration{
    public PurchaseCollocationConfig(){
        this.setProperty("cargoId")
            .hasAttribute(new DisplayNameAttribute("货品主表id"));

        this.setProperty("collocationId")
            .hasAttribute(new DisplayNameAttribute("货品子表id"));

        this.setProperty("purchaseNum")
            .hasAttribute(new DisplayNameAttribute("采购数量"))
            .hasAttribute(new RegularExpressionAttribute(MathRegularExpressions.naturalNumber));

        this.setProperty("purchasePrice")
            .hasAttribute(new DisplayNameAttribute("采购单价"));

        this.setProperty("shopId")
            .hasAttribute(new DisplayNameAttribute("门店"));

        this.setProperty("comment")
            .hasAttribute(new DisplayNameAttribute("备注"));
        
        this.setProperty("supplierId")
	        .hasAttribute(new DisplayNameAttribute("供应商"))
	    	.hasAttribute(new DropDownListAttribute(new SupplierProvider()));

    }
}